package com.yonyou.cyxdms.sysAuth.service.mapper;

import com.yonyou.cyx.framework.dao.base.SuperMapper;
import com.yonyou.cyxdms.framework.bean.dto.user_info.LoginInfoDto;
import com.yonyou.cyxdms.sysAuth.service.entity.PermissionMenuPO;
import com.yonyou.cyxdms.sysAuth.service.vo.employee.UserPermissionMenuVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 菜单权限表 Mapper 接口
 * </p>
 *
 * @author quankk
 * @since 2019-07-05
 */
public interface PermissionMenuMapper extends SuperMapper<PermissionMenuPO> {
    /**
     * @description：菜单控制权限
     * @author     ：maxingjian
     * @date       ：Created in 2019/7/10
     * @modified By：
     */
    List<Map> queryPermissionMenu(@Param("orgType")Integer orgType,@Param("permissionType")Integer permissionType, @Param("params") Map<String, Object> params);

    void deletePermissionMenu(@Param("permissionId")Long permissionId, @Param("permissionType")Integer permissionType);

    void updatePermissionMenu(@Param("isEmpowered")Integer isEmpowered, @Param("permissionId")Long permissionId, @Param("permissionType")Integer permissionType);

    Map<String,Object> isFixed();

    List<Map<String,Object>> queryPermissionMenu2(@Param("orgType")Integer orgType, @Param("productType")Integer productType, @Param("roleids")List<String> roleids, @Param("permissionType")Integer permissionType);

    List<Long>  selectIdByMenuIdAndRoleId(@Param("menuId") Long menuId, @Param("appId") String appId, @Param("roleId") Integer roleId);

    void deletePermissionMenus(@Param("type") Integer type, @Param("userOrgId") Long userOrgId, @Param("deleteMenuIds") List<Long> deleteMenuIds);

    List<Long> queryIdByUserOrgId(@Param("userOrgId") Long userOrgId);

    void deletePM(@Param("permissionMenuIds") List<Long> permissionMenuIds);

    List<PermissionMenuPO> findPermissionByRoles(@Param("newRoleIds") List<Long> newRoleIds);

    List<Map> queryPermissionMenu3(@Param("orgType") Integer orgType, @Param("permissionType") Integer permissionType, @Param("params") Map<String, Object> params, @Param("appId") String appId);

    void updateOldRolePer(@Param("userOrgId") Long userOrgId);

    void updateOldRolePermission(@Param("roleId") Long roleId);

    void updatePermission(@Param("newRoleIds") List<Long> newRoleIds);

    void insertUserMenu(@Param("roleIds") List<Long> roleIds, @Param("userOrgId") Long userOrgId, @Param("createdBy") Long createdBy, @Param("appId") String appId);

    List<Long> findMenuIds(@Param("userOrgId") Long userOrgId);

    void insertOtherMenu(@Param("userOrgId") Long userOrgId, @Param("appId") String appId, @Param("createdBy") Long createdBy, @Param("dataType") Long dataType);

    void insertOtherRoleMenu(@Param("roleId") Long roleId, @Param("appId") String appId, @Param("createdBy") Long createdBy, @Param("dataType") Integer dataType);

    void insertOtherMenus(@Param("userOrgId") Long userOrgId, @Param("appId") String appId, @Param("createdBy") Long createdBy, @Param("dataType") Long dataType);

    List<UserPermissionMenuVO> selectPermissionMenuIds(@Param("roleIds") List<Long> roleIds);

    Long findPermissionMenuId(@Param("menuId") Long menuId, @Param("userOrgId") Long userOrgId);

    void updateNewRolePer(@Param("userOrgId") Long userOrgId, @Param("roleIds")List<Long> roleIds);

    void updateByMenuIds(@Param("userOrgId") Long userOrgId, @Param("sourceStrArray") String[] sourceStrArray, @Param("updatedBy") Long updatedBy);

    List<Map> queryPermissionMenu4(@Param("orgType") Integer orgType, @Param("permissionType") Integer permissionType, @Param("userOrgId") String userOrgId, @Param("appId") String appId);

    void insertMenu(@Param("appId") String appId, @Param("permissionId") Long permissionId, @Param("permissionType") Integer permissionType, @Param("permissionId1") Long permissionId1, @Param("permissionType1") Integer permissionType1, @Param("createdBy") String createdBy);

    void deletePermissionMenusByPerIds(@Param("permissionType") Integer permissionId, @Param("userOrgIds") List<Long> userOrgIds);

    void updateByMenuIdsAndRoleId(@Param("roleId") Long roleId, @Param("sourceStrArray") String[] sourceStrArray);

    void insertUpdateMenuOem(@Param("appId")String appId,@Param("roleId") Long roleId);

    void insertUpdateMenuDlr(@Param("appId")String appId,@Param("roleId") Long roleId);

    void deleteByRoleId(@Param("roleId") Long roleId);

    void updateRecordVersion(@Param("userOrgId") String userOrgId, @Param("menuList") List<Long> menuList);

}
